<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> {% block title %} SemRate {% endblock %}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel='stylesheet' type='text/css' href='/site_media/style.css'/>
<script type="text/javascript" src="/site_media/jquery-1.7.min.js"></script>
<script type="text/javascript">

function items(obj) {
  s = '';
  for (var x in obj) {
    s = s + x + ' : ' + obj[x] + '\n'
  };
  return s;
}

function formToDict(form) {
  var values = {};
  $.each($(form).serializeArray(), function(i, field) {
      values[field.name] = field.value;
  });
  return values;
};


function debug(s) {
  $('#debugdiv').append('<p class="debug_p">' + s + '</p>')
};

function init() {
  debug('hello world');
};

function dir(obj) {
  s = '';
  for(var key in obj) {
      s = s + ', ' + key + '\n';
  }
  return s;
}

$(init);

</script>


<!-- FREEBASE -->

<link type="text/css" rel="stylesheet" href="http://freebaselibs.com/static/suggest/1.3/suggest.min.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://freebaselibs.com/static/suggest/1.3/suggest.min.js"></script>
<script type="text/javascript">

function fooz(e) {
  alert(e.id);
}

$(function() {
  x = $("#category_name_input").suggest({ type:'type'});
  x.bind('fb-select', function(e, data) { console.log('suggest: ', data.id); });
});


</script>




</head>
<body>
{% block body %}
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/tr_TR/all.js#xfbml=1&appId=101869399932287";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


<div id='header'>
<table id='headertable'>
  <tr>
	<td style='width: 100px;'></td>
	<td style='width: 400px;'><h1 class='header_heading'> SemRate </h1></td>
	<td style='width: 200px;' style='vertical-align: top;'>
		{% if user.is_authenticated %}
	  <span style=' margin-left: 20px;'> Logged in as: {{user.username}}  </span><br/>
	  {% if facebook_id %}
		<img src="https://graph.facebook.com/{{facebook_id}}/picture"/>
	  {% endif %}<br/>
			<a class='discrete_link' style='color: #6cf; font-size:8pt; margin-left: 20px; margin-top: 5px;' href="/accounts/logout/">[Logout]</a>
<!--             <a class='discrete_link' style='color: #6cf; font-size:8pt; margin-left: 5px; margin-top: 5px;' href="/accounts/inbox/" >[Inbox]{% if messages_inbox_count %}{{ messages_inbox_count }} {% endif %}</a> -->
	        <a class='discrete_link' style='color: #6cf; font-size:8pt; margin-left: 5px; margin-top: 5px;' href="/user/{{request.user}}">[Profile]</a> <br/>
		{% else %}
	  
	  <span style=' margin-left: 20px;'> Not logged in. </span><br/>
	  <a class='discrete_link' style='display: block; color: #6cf; font-size:8pt; margin-left: 20px; margin-top: 5px;' href="/accounts/login/">[Login]</a>

		{% endif %}
	</td>
  </tr>
</table>
<a class='menuitem' href='/'>Home</a>
<a class='menuitem' href='/newproduct'>Create Product</a>
<a class='menuitem' href='/categories'>List Categories</a>


</div>

<div id='content'>
{% block content %}
{% endblock %}
</div>

<div id='debugdiv'>
</div>
{% endblock %}

</body>
</html>
